import java.util.HashSet;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //用哈希表
        String str1 = scanner.nextLine();
        String str2 = scanner.nextLine();
        HashSet<Character> hashSet = new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            hashSet.add(str2.charAt(i));
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < str1.length(); i++) {
            if(!hashSet.contains(str1.charAt(i))){
                stringBuilder.append(str1.charAt(i));
            }
        }
        System.out.println(stringBuilder.toString());


    }
}
